Skip to content

Metric semigroups #1447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft

Metric semigroups #1447

wants to merge 11 commits into from

Conversation

malarbol
Copy link
Collaborator

@malarbol malarbol commented Jun 17, 2025

This PR introduces the notion of Metric-Semigroup, metric spaces with a short associative binary operator.

Credit @lowasser for 9e36ee4

Comment on lines 46 to 48
short-function-Metric-Space
( A)
( metric-space-of-short-functions-Metric-Space A A) →
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it formalized somewhere that metric-space-of-short-functions-Metric-Space A is right adjoint to "product-Metric-Space A", so that this can confidently be used for "binary short functions"?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise that might be a good sanity-check to formalize

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it formalized somewhere that metric-space-of-short-functions-Metric-Space A is right adjoint to "product-Metric-Space A", so that this can confidently be used for "binary short functions"?

I don't think so, we didn't do much in the categorical POV of metric spaces. I don't think we even have the concept "product-Metric-Space A" Do you think it's true? If so, I guess we could add this result sometimes in the future. I've never worked with right adjoints and I'm still working on #1421 so I'll need some time to think about it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be true, and I think it is a question worth considering since you are defining what it means to be a binary short function here. If it is not true you may be giving a wrong definition. The adjointedness condition I mention is known in the literature as cartesian closedness, and means that we can observe collections of morphisms in the category as internal objects in the category itself. E.g., given that it is true, the metric space of short functions between two metric spaces represent in a concrete sense the collection of short functions viewed internally. The concrete way in which it represents this collection is precisely by the equivalence

$$\mathrm{Hom}(A \times B, C) \cong \mathrm{Hom}(A, C^B)$$

Where $\mathrm{Hom}$ is the type of short functions, $A \times B$ is the product metric space, and $C^B$ is the metric space of short functions. This equivalence is what the adjointedness condition I mention would unfold to.

Copy link
Collaborator

@fredrik-bakke fredrik-bakke Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question I'd like you to ask yourself is: what is the difference between

    short-function-Metric-Space A (metric-space-of-short-functions-Metric-Space A A)

and

    short-function-Metric-Space (product-Metric-Space A A) A

Are they the same? If so, there is no problem.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, basically, I could construct an isometry

  isometry-ev-pair-short-function-product-Metric-Space :
    isometry-Metric-Space
      ( metric-space-of-short-functions-Metric-Space
        ( product-Metric-Space X Y)
        ( Z))
      ( metric-space-of-short-functions-Metric-Space
        ( X)
        ( metric-space-of-short-functions-Metric-Space Y Z))

and and inverse in the space of functions product-Metric-Space X Y -> Z

  map-ind-short-function-product-Metric-Space :
    short-function-Metric-Space
      ( X)
      ( metric-space-of-short-functions-Metric-Space Y Z) 
    map-type-Metric-Space
      ( product-Metric-Space X Y)
      ( Z)

If the latter takes value in the space of short functions, then we have

    metric-space-of-short-functions-Metric-Space
      ( product-Metric-Space X Y)
      ( Z) =
    metric-space-of-short-functions-Metric-Space
      ( X)
      ( metric-space-of-short-functions-Metric-Space Y Z)

but I don't know how to prove this last step. Do you have any idea how to complete this proof? Or maybe it's not always true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If anyone is reading this:

  • with this setting, I can prove that map-ind-short-function-product-Metric-Space f is uniformly continuous, but still not short;
  • I'm starting to believe it's not true: add-ℚ is a
short-function-Metric-Space
  ( ℚ)
  ( metric-space-of-short-functions-Metric-Space ℚ ℚ)

but I don't think it's short as a function product-Metric-Space ℚ ℚ → ℚ.

So, regarding #1447 (comment), let's assume they're not the same and we have a problem. How should we solve it?

NB: whatever the definition of Metric-Semigroup ends up being, I think we'd want ℚ , add-ℚ to be an instance of it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems impossible to me that add-ℚ is not a short function viewed as product-Metric-Space ℚ ℚ → ℚ, considering it is commutative. Are you sure this is the case?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on this Wikipedia page, I propose you define the product metric space using the supremum, i.e. maximum distance of the coordinates, and then use short-function-Metric-Space (product-Metric-Space A A) A in your definitions. This should always be correct, and then we can later resolve the question of wheter short-function-Metric-Space A (metric-space-of-short-functions-Metric-Space A A) is equivalent or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on this Wikipedia page, I propose you define the product metric space using the supremum, i.e. maximum distance of the coordinates,

I think that's what this definition does: upper bounds of the "product distance" are upper bounds on each coordinates, i.e. upper bounds of the max if the distances. This is also coherent with the definition of "dependent product of metric spaces" where the distance is the supremum.

It seems impossible to me that add-ℚ is not a short function viewed as product-Metric-Space ℚ ℚ → ℚ, considering it is commutative.

I was surprised too, and I don't see how commutativity should help...

Are you sure this is the case?

Unless I'm mistaken, it basically boils down to proving that

|(x + y) - (x' + y')| ≤ max (|x - x'| , |y - y'|) 

and I don't see a way out. It is a lipschitz-function-Metric-Space (product-Metric-Space A A) A though. Would that help?

then use short-function-Metric-Space (product-Metric-Space A A) A in your definitions. This should always be correct, and then we can later resolve the question of wheter short-function-Metric-Space A (metric-space-of-short-functions-Metric-Space A A) is equivalent or not.

So ℚ , add-ℚ will not be a metric semigroup?

@malarbol
Copy link
Collaborator Author

This is also a suggestion of prelude for some Analysis-Space mentioned in #1445. Actually, if we think of the analysis module as an intersection of algebraic structures (groups, rings, linear algebra) and convergence structures (metric-spaces, topological-spaces in the future, etc.), this could probably go to analysis/metric-semigroups.lagda.md.

@fredrik-bakke
Copy link
Collaborator

This is also a suggestion of prelude for some Analysis-Space mentioned in #1445.

I don't see the need for using such a generic term as Analysis-Space, when the object at hand seems to be essentially a Banach-Ring.

Actually, if we think of the analysis module as an intersection of algebraic structures (groups, rings, linear algebra) and convergence structures (metric-spaces, topological-spaces in the future, etc.), this could probably go to analysis/metric-semigroups.lagda.md.

I like this idea!

@malarbol
Copy link
Collaborator Author

This is also a suggestion of prelude for some Analysis-Space mentioned in #1445.

I don't see the need for using such a generic term as Analysis-Space, when the object at hand seems to be essentially a Banach-Ring.

Sure, at the moment Analysis-Space is just a placeholder name for the concept we are trying to pin out. It might as well be Complete-Metric-Ring. I think Banach-Space would fit better for complete metric spaces where all elements are at finite distance (what I formerly called total complete metric space) so that Banach fixed point theorem holds in Banach spaces.

Actually, if we think of the analysis module as an intersection of algebraic structures (groups, rings, linear algebra) and convergence structures (metric-spaces, topological-spaces in the future, etc.), this could probably go to analysis/metric-semigroups.lagda.md.

I like this idea!

Thanks. I'll move the module.

@fredrik-bakke
Copy link
Collaborator

Sure, at the moment Analysis-Space is just a placeholder name for the concept we are trying to pin out. It might as well be Complete-Metric-Ring. I think Banach-Space would fit better for complete metric spaces where all elements are at finite distance (what I formerly called total complete metric space) so that Banach fixed point theorem holds in Banach spaces.

Good, just wanted to make sure we are on the same page. Keep in mind that a banach space is also a vector space 👍

## Idea

A {{#concept "metric semigroup" Agda=Metric-Semigroup}} is a
[metric-space](metric-spaces.metric-spaces.md) equipped with a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[metric-space](metric-spaces.metric-spaces.md) equipped with a
[metric space](metric-spaces.metric-spaces.md) [equipped](foundation.structure.md) with a

Comment on lines +52 to +54
A pair of [metric spaces](metric-spaces.metric-spaces.md) induces a metric space
over the [Cartesian product](foundation.cartesian-product-types.md) of the
carrier types of its arguments.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and in fact there is an infinite family of equivalent choices of metric on the product. One for every "real number" in $(0,\infty]$. The canonical choice is $\infty$.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which is what you've chosen below I think

is-local-structure-product-Metric-Space :
is-local-Premetric structure-product-Metric-Space
is-local-structure-product-Metric-Space =
is-local-is-tight-Premetric
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you could add is-tight-structure-product-Metric-Space as another lemma?

type-product-Metric-Space : UU (l1 ⊔ l3)
type-product-Metric-Space = type-Metric-Space A × type-Metric-Space B

structure-product-Metric-Space : Premetric (l2 ⊔ l4) type-product-Metric-Space
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not call it premetric-product-Metric-Space?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after #1421 there will be no more "premetrics". With #1450 this would probably be something like

neighborhood-prop-product-Metric-Space : Rational-Neighborhood-Relation (l2 ⊔ l4) type-product-Metric-Space

Comment on lines +331 to +338
isometry-ev-pair-short-function-product-Metric-Space :
isometry-Metric-Space
( metric-space-of-short-functions-Metric-Space
( product-Metric-Space X Y)
( Z))
( metric-space-of-short-functions-Metric-Space
( X)
( metric-space-of-short-functions-Metric-Space Y Z))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, doesn't this show that the category of metric spaces is cartesian closed? 🤩

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, isometries don't characterize equality

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a bummer. So then only the category of "metric spaces up to isometry" is cartesian closed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still I find it strange if they are not equivalent...

@malarbol malarbol marked this pull request as draft July 16, 2025 01:27
@malarbol
Copy link
Collaborator Author

There are sill a lot of open questions on this PR so I'll put in draft-mode until we figure things out. In the meantime I hope we can have a look at #1450 so we can advance on #1421 etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants